package com.he.buildermodel.director;

import com.he.buildermodel.builder.Carbuilder;

/**
 * 指挥者，包含builder接口引用,为builder接口进行具体装配。<br/>
 * 在这里将product类装配完毕
 * @param <T>
 */
public class CarDirector<T> {
    private Carbuilder<T> carbuilder;

    public CarDirector(Carbuilder carbuilder) {
        this.carbuilder = carbuilder;
    }

    public T buildCar() {
        carbuilder.setName();
        carbuilder.setPrice();
        carbuilder.addFeature();
        return carbuilder.getCar();
    }
}
